<?php

/**
 * @package Framework03
 * @author Walter Tamboer
 */

/**
 * The benchmark class.
 */
class Benchmark extends Object
{
	/**
	 * The stack array.
	 */
	private $Markers;
	/**
	 * All meassured marks.
	 */
	private $Results;
	/**
	 * Initializes a new instance of this class.
	 */
	public function __construct()
	{
		$this->Markers = array();
		$this->Results = array();
	}
	/**
	 * Begins a benchmark.
	 * @param string $Name The name of the benchmark.
	 */
	public function Begin($Name)
	{
		$this->Markers[$Name] = microtime();
	}
	/**
	 * Ends a benchmark.
	 * @param string $Name The name of the benchmark.
	 */
	public function End($Name)
	{
		$this->Results[$Name] = microtime() - $this->Markers[$Index];
	}
}

?>